Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

procstat speed improvement #7686

Merged
merged 1 commit into from
Jun 16, 2020
Merged

procstat speed improvement #7686

merged 1 commit into from
Jun 16, 2020

Conversation

ssoroka
Copy link
Contributor

@ssoroka ssoroka commented Jun 15, 2020

Will improve the situation for #7642
darwin:
before

$ go test -short ./plugins/inputs/procstat/... -bench=. -benchmem
goos: darwin
goarch: amd64
pkg: github.com/influxdata/telegraf/plugins/inputs/procstat
BenchmarkPattern-12        	       1	1600582288 ns/op	 5874216 B/op	   48391 allocs/op
BenchmarkFullPattern-12    	       1	3620761444 ns/op	11612472 B/op	   86876 allocs/op
PASS
ok  	github.com/influxdata/telegraf/plugins/inputs/procstat	5.450s

after

$ go test -short ./plugins/inputs/procstat/... -bench=. -benchmem
goos: darwin
goarch: amd64
pkg: github.com/influxdata/telegraf/plugins/inputs/procstat
BenchmarkPattern-12        	      57	  25058656 ns/op	  309886 B/op	    2991 allocs/op
BenchmarkFullPattern-12    	       1	1798469106 ns/op	 6176720 B/op	   41895 allocs/op
PASS
ok  	github.com/influxdata/telegraf/plugins/inputs/procstat	3.466s

@danielnelson danielnelson added this to the 1.14.5 milestone Jun 16, 2020
@danielnelson danielnelson added the performance problems with decreased performance or enhancements that improve performance label Jun 16, 2020
@danielnelson
Copy link
Contributor

Linux comparisons

go test -short ./plugins/inputs/procstat --bench=. -benchmem
goos: linux
goarch: amd64
pkg: github.com/influxdata/telegraf/plugins/inputs/procstat
BenchmarkPattern-4                    14          80332678 ns/op        20518161 B/op     215585 allocs/op
BenchmarkFullPattern-4                14          80817491 ns/op        20781215 B/op     216293 allocs/op
PASS
ok      github.com/influxdata/telegraf/plugins/inputs/procstat  2.450s
go test -short ./plugins/inputs/procstat --bench=. -benchmem
goos: linux
goarch: amd64
pkg: github.com/influxdata/telegraf/plugins/inputs/procstat
BenchmarkPattern-4                  2005            601808 ns/op          105720 B/op       1636 allocs/op
BenchmarkFullPattern-4               655           1869698 ns/op          369833 B/op       2349 allocs/op
PASS
ok      github.com/influxdata/telegraf/plugins/inputs/procstat  2.712s

@ssoroka ssoroka merged commit 0e6566a into master Jun 16, 2020
@ssoroka ssoroka deleted the procstat-finder branch June 16, 2020 17:46
ssoroka added a commit that referenced this pull request Jun 16, 2020
up to 40/120x better performance on FullPattern/Pattern functions
rhajek pushed a commit to bonitoo-io/telegraf that referenced this pull request Jul 13, 2020
up to 40/120x better performance on FullPattern/Pattern functions
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
up to 40/120x better performance on FullPattern/Pattern functions
rmfitzpatrick pushed a commit to signalfx/telegraf that referenced this pull request Dec 11, 2020
up to 40/120x better performance on FullPattern/Pattern functions
rmfitzpatrick pushed a commit to signalfx/telegraf that referenced this pull request Dec 11, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
up to 40/120x better performance on FullPattern/Pattern functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance problems with decreased performance or enhancements that improve performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants